package com.movie2.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName relation
 */
@TableName(value ="relation")
@Data
public class Relation implements Serializable {
    /**
     * 
     */
    @TableField(value = "one_id")
    private Integer oneId;

    /**
     * 
     */
    @TableField(value = "two_id")
    private Integer twoId;

    /**
     * 
     */
    @TableField(value = "ord")
    private Integer ord;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Relation other = (Relation) that;
        return (this.getOneId() == null ? other.getOneId() == null : this.getOneId().equals(other.getOneId()))
            && (this.getTwoId() == null ? other.getTwoId() == null : this.getTwoId().equals(other.getTwoId()))
            && (this.getOrd() == null ? other.getOrd() == null : this.getOrd().equals(other.getOrd()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOneId() == null) ? 0 : getOneId().hashCode());
        result = prime * result + ((getTwoId() == null) ? 0 : getTwoId().hashCode());
        result = prime * result + ((getOrd() == null) ? 0 : getOrd().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", oneId=").append(oneId);
        sb.append(", twoId=").append(twoId);
        sb.append(", ord=").append(ord);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}